﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Cgd.Shell.Data;

public partial class RssFeed : System.Web.UI.Page
{
	protected CgdColumn _pColumn;

	protected void Page_Init(object sender, EventArgs e)
	{
		try
		{
			int c = int.Parse(Request["c"]);
			_pColumn = CgdColumn.GetByValue(c);
			this.Title = _pColumn.Title;
			lblColumn.Text = this.Title;
		}
		catch
		{
			Response.StatusCode = 404;
			Response.End();
			return;
		}
	}

	protected void Page_Load(object sender, EventArgs e)
	{
	}

	protected void ListView1_ItemInserting(object sender, ListViewInsertEventArgs e)
	{
		e.Values.Add("Id", Guid.NewGuid());
		e.Values.Add("Category", _pColumn.Value);

		DateTime lastReadTime = (DateTime)e.Values["LastReadTime"];
		if (lastReadTime == DateTime.MinValue)
			e.Values["lastReadTime"] = DateTime.Now;
	}
}
